package com.yjd.back.interceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.yjd.comm.base.interceptor.BaseInterceptor;
import com.yjd.comm.system.dto.AdminDataWrap;
import com.yjd.comm.system.util.AdminDataUtil;

/**
 * @ClassName: AdminDataWrapInterceptor
 * @Description: 用户信息封装拦截器
 * @author ready likun_557@163.com
 * @date 2014-8-19 下午3:30:52
 */
public class AdminDataWrapInterceptor extends BaseInterceptor {

	@Override
	public boolean doPreHandle(HttpServletRequest request,
			HttpServletResponse response, Object handler) throws Exception {
		AdminDataWrap adminDataWrap = AdminDataUtil.getAdminDataWrap(request,
				response);
		if (adminDataWrap != null) {
			request.setAttribute("userMenuJson",
					adminDataWrap.getUserMenuJson());
			request.setAttribute("adminData", adminDataWrap);
		}
		return true;
	}

}
